﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Maestro.master" AutoEventWireup="true" CodeFile="IngresoProductos.aspx.cs" Inherits="IngresoProductos" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style3
        {
            height: 24px;
        }
        </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
     <table align="center" bgcolor="White" >
        <tr>
            <td>&nbsp;</td>
            <td colspan="2">
                
                <table>
                    <tr>
                        <td style="text-align: left">
                            <asp:ScriptManager ID="ScriptManager1" runat="server">
                            </asp:ScriptManager>
                            Número<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td style="text-align: left">
                            Proveedor<dx:ASPxComboBox ID="ASPxComboBox1" runat="server">
                            </dx:ASPxComboBox>
                        </td>
                        <td style="text-align: left">
                            Orden de compra<dx:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td style="text-align: left">
                            Ingreso
                            <dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server">
                            </dx:ASPxDateEdit>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="text-align: left">
                            Observaciones<dx:ASPxTextBox ID="ASPxTextBox3" runat="server" Width="100%">
                            </dx:ASPxTextBox>
                        </td>
                        
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <dxwgv:ASPxGridView ID="gvLineasDeRemito" runat="server" 
                                        AutoGenerateColumns="False" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" 
                                        CssPostfix="Aqua" DataSourceID="dsLineasDeRemito">
                                        <Columns>
                                            <dxwgv:GridViewDataTextColumn FieldName="ID" Visible="False" VisibleIndex="0">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn FieldName="IdRemito" Visible="False" 
                                                VisibleIndex="1">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn FieldName="IdMovimientoStock" Visible="False" 
                                                VisibleIndex="2">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn Caption="Producto" 
                                                FieldName="StockProductoNombre" ReadOnly="True" VisibleIndex="0">
                                            </dxwgv:GridViewDataTextColumn>
                                            <dxwgv:GridViewDataTextColumn FieldName="Cantidad" VisibleIndex="1">
                                            </dxwgv:GridViewDataTextColumn>
                                        </Columns>
                                        <SettingsPager Mode="ShowAllRecords">
                                            <AllButton>
                                                <Image Height="19px" Width="27px" />
                                            </AllButton>
                                            <FirstPageButton>
                                                <Image Height="19px" Width="23px" />
                                            </FirstPageButton>
                                            <LastPageButton>
                                                <Image Height="19px" Width="23px" />
                                            </LastPageButton>
                                            <NextPageButton>
                                                <Image Height="19px" Width="19px" />
                                            </NextPageButton>
                                            <PrevPageButton>
                                                <Image Height="19px" Width="19px" />
                                            </PrevPageButton>
                                        </SettingsPager>
                                        <SettingsLoadingPanel Text="" />
                                        <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                                            <CollapsedButton Height="15px" 
                                                Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
                                            <ExpandedButton Height="15px" 
                                                Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
                                            <DetailCollapsedButton Height="15px" 
                                                Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
                                            <DetailExpandedButton Height="15px" 
                                                Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
                                            <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" 
                                                Width="19px" />
                                            <HeaderActiveFilter Height="19px" 
                                                Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
                                            <HeaderSortDown Height="5px" 
                                                Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
                                            <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" 
                                                Width="7px" />
                                            <FilterRowButton Height="13px" Width="13px" />
                                            <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" 
                                                Width="13px" />
                                        </Images>
                                        <ImagesEditors>
                                            <CalendarFastNavPrevYear Height="19px" 
                                                Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
                                            <CalendarFastNavNextYear Height="19px" 
                                                Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
                                            <DropDownEditDropDown Height="7px" 
                                                Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                                                UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                                                UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                                                Width="9px" />
                                            <SpinEditIncrement Height="7px" 
                                                Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png" 
                                                UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" 
                                                UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                                                UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                                                Width="7px" />
                                            <SpinEditDecrement Height="7px" 
                                                Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png" 
                                                UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" 
                                                UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                                                UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                                                Width="7px" />
                                            <SpinEditLargeIncrement Height="9px" 
                                                Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png" 
                                                UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" 
                                                UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                                                UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                                                Width="7px" />
                                            <SpinEditLargeDecrement Height="9px" 
                                                Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png" 
                                                UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" 
                                                UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                                                UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                                                Width="7px" />
                                        </ImagesEditors>
                                        <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
                                        </Styles>
                                        <StylesEditors>
                                            <ProgressBar Height="25px">
                                            </ProgressBar>
                                        </StylesEditors>
                                    </dxwgv:ASPxGridView>
                                    <asp:ObjectDataSource ID="dsLineasDeRemito" runat="server" 
                                        OldValuesParameterFormatString="original_{0}" 
                                        onselecting="dsLineasDeRemito_Selecting" 
                                        SelectMethod="ObtenerLineasDeRemitoSinBusqueda" 
                                        TypeName="SGT_ON.StockLineaDeRemito">
                                        <SelectParameters>
                                            <asp:Parameter Name="pLineasADevolver" Type="Object" />
                                        </SelectParameters>
                                    </asp:ObjectDataSource>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="gvProductos" 
                                        EventName="CustomButtonCallback" />
                                </Triggers>
                            </asp:UpdatePanel>
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td colspan = "4" style="text-align: left">
                         
                            &nbsp;</td>
                    </tr>
                </table>
                
            </td>
        </tr>
         <tr>
             <td>
                 &nbsp;</td>
             <td style="text-align: left" valign="top">
                 <table>
                     <tr>
                         <td class="style3">
                 <dx:ASPxTextBox ID="txtBuscar" runat="server" Width="170px">
                     <ValidationSettings ErrorTextPosition="Bottom">
<RequiredField IsRequired="True" ErrorText="Debe ingresar un texto"></RequiredField>
                     </ValidationSettings>
                 </dx:ASPxTextBox>
                         </td>
                         <td class="style3" valign="top">
                             <asp:ImageButton ID="btnBuscar" runat="server" ImageUrl="~/Imagenes/lupa.gif" 
                                 Width="20px" onclick="btnBuscar_Click" />
                         </td>
                     </tr>
                 </table>
             </td>
             <td >
                 &nbsp;</td>
         </tr>
         <tr>
             <td>
                 &nbsp;</td>
             <td>
                 <dxwgv:ASPxGridView ID="gvProductos" runat="server" 
                     CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                     DataSourceID="dsProductos" AutoGenerateColumns="False" KeyFieldName="ID" 
                     ondatabound="gvProductos_DataBound" 
                     oncustombuttoncallback="gvProductos_CustomButtonCallback">
                     <Columns>
                         <dxwgv:GridViewDataTextColumn FieldName="ID" ShowInCustomizationForm="False" 
                             Visible="False" VisibleIndex="0">
                         </dxwgv:GridViewDataTextColumn>
                         <dxwgv:GridViewDataTextColumn FieldName="Nombre" VisibleIndex="0">
                         </dxwgv:GridViewDataTextColumn>
                         <dxwgv:GridViewDataTextColumn FieldName="CodigoOriginal" VisibleIndex="1" 
                             Name="CodigoOriginal">
                         </dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="CodigoTaller" ShowInCustomizationForm="True" VisibleIndex="2" 
                             Name="CodigoTaller"></dxwgv:GridViewDataTextColumn>
                         <dxwgv:GridViewDataTextColumn VisibleIndex="3" Caption="Cantidad" 
                             ShowInCustomizationForm="True" Name="Cantidad">
                             <DataItemTemplate>
                                 <table cellpadding="0" cellspacing="0">
                                     <tr>
                                         <td>
                                             <dx:ASPxTextBox ID="txtCantidad" runat="server" Width="50px">
                                             </dx:ASPxTextBox>
                                         </td>
                                         <td align="left">
                                             &nbsp;
                                             <asp:Label ID="lblUnidadDeMedida" runat="server" 
                                                 Text='<%# Eval("UnidadDeMedida") %>' Width="70px"></asp:Label>
                                             
                                         </td>
                                         <td align="right">
                                             <asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>' Visible="False"></asp:Label>
                                         <asp:Button ID="btnAgregar" runat="server" onclick="btnAgregar_Click1" 
                                                 Text="Agregar" style="text-align: right" />
                                         </td>
                                     </tr>
                                 </table>
                             </DataItemTemplate>
                         </dxwgv:GridViewDataTextColumn>
                     </Columns>
                     <SettingsBehavior AllowFocusedRow="True" />
                     <SettingsPager>
                         <AllButton>
                             <Image Height="19px" Width="27px" />
<Image Height="19px" Width="27px"></Image>
                         </AllButton>
                         <FirstPageButton>
                             <Image Height="19px" Width="23px" />
<Image Height="19px" Width="23px"></Image>
                         </FirstPageButton>
                         <LastPageButton>
                             <Image Height="19px" Width="23px" />
<Image Height="19px" Width="23px"></Image>
                         </LastPageButton>
                         <NextPageButton>
                             <Image Height="19px" Width="19px" />
<Image Height="19px" Width="19px"></Image>
                         </NextPageButton>
                         <PrevPageButton>
                             <Image Height="19px" Width="19px" />
<Image Height="19px" Width="19px"></Image>
                         </PrevPageButton>
                     </SettingsPager>
                     <SettingsLoadingPanel Text="" />
                     <SettingsText EmptyDataRow="No se han encontrado productos" />

<SettingsLoadingPanel Text=""></SettingsLoadingPanel>

                     <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                         <CollapsedButton Height="15px" 
                             Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
                         <ExpandedButton Height="15px" 
                             Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
                         <DetailCollapsedButton Height="15px" 
                             Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
                         <DetailExpandedButton Height="15px" 
                             Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
                         <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" 
                             Width="19px" />
                         <HeaderActiveFilter Height="19px" 
                             Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
                         <HeaderSortDown Height="5px" 
                             Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
                         <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" 
                             Width="7px" />
                         <FilterRowButton Height="13px" Width="13px" />
                         <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" 
                             Width="13px" />
<CollapsedButton Height="15px" Width="15px" Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png"></CollapsedButton>

<ExpandedButton Height="15px" Width="15px" Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png"></ExpandedButton>

<DetailCollapsedButton Height="15px" Width="15px" Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png"></DetailCollapsedButton>

<DetailExpandedButton Height="15px" Width="15px" Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png"></DetailExpandedButton>

<HeaderFilter Height="19px" Width="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png"></HeaderFilter>

<HeaderActiveFilter Height="19px" Width="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png"></HeaderActiveFilter>

<HeaderSortDown Height="5px" Width="7px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png"></HeaderSortDown>

<HeaderSortUp Height="5px" Width="7px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png"></HeaderSortUp>

<FilterRowButton Height="13px" Width="13px"></FilterRowButton>

<WindowResizer Height="13px" Width="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png"></WindowResizer>
                     </Images>
                     <ImagesEditors>
                         <CalendarFastNavPrevYear Height="19px" 
                             Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
                         <CalendarFastNavNextYear Height="19px" 
                             Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
                         <DropDownEditDropDown Height="7px" 
                             Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                             UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                             UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                             Width="9px" />
                         <SpinEditIncrement Height="7px" 
                             Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png" 
                             UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" 
                             UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                             UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                             Width="7px" />
                         <SpinEditDecrement Height="7px" 
                             Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png" 
                             UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" 
                             UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                             UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                             Width="7px" />
                         <SpinEditLargeIncrement Height="9px" 
                             Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png" 
                             UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" 
                             UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                             UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                             Width="7px" />
                         <SpinEditLargeDecrement Height="9px" 
                             Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png" 
                             UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" 
                             UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                             UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                             Width="7px" />
<CalendarFastNavPrevYear Height="19px" Width="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png"></CalendarFastNavPrevYear>

<CalendarFastNavNextYear Height="19px" Width="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png"></CalendarFastNavNextYear>

<DropDownEditDropDown UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" Height="7px" Width="9px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png"></DropDownEditDropDown>

<SpinEditIncrement UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" Height="7px" Width="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png"></SpinEditIncrement>

<SpinEditDecrement UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" Height="7px" Width="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png"></SpinEditDecrement>

<SpinEditLargeIncrement UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" Height="9px" Width="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png"></SpinEditLargeIncrement>

<SpinEditLargeDecrement UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" Height="9px" Width="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png"></SpinEditLargeDecrement>
                     </ImagesEditors>
                     <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
                     </Styles>
                     <StylesEditors>
                         <ProgressBar Height="25px">
                         </ProgressBar>
                     </StylesEditors>
                 </dxwgv:ASPxGridView>
                 <asp:ObjectDataSource ID="dsProductos" runat="server" 
                     OldValuesParameterFormatString="original_{0}" SelectMethod="ObtenerPorTexto" 
                     TypeName="SGT_ON.StockProducto" onselecting="dsProductos_Selecting">
                     <SelectParameters>
                         <asp:ControlParameter ControlID="txtBuscar" Name="pTexto" PropertyName="Text" 
                             Type="String" />
                     </SelectParameters>
                 </asp:ObjectDataSource>
             </td>
             <td></td>
         </tr>
     </table>
</asp:Content>

